import { HttpHelper } from "./HttpHelper";
export class ContryHelper {
    private static contries: any[];
    static init = async () => {
        return;
        try {
            ContryHelper.contries = JSON.parse(await HttpHelper.get(`/CustomerDefault/GetContries`, null));
            console.log("国家数据数量：", ContryHelper.contries.length);
        } catch (error:any) {
            if (error && error.statusCode == 404) {
                console.error("拉取国家返回404");
                return;
            }
            window.setTimeout(ContryHelper.init, 1000);
        }
    }
    static getContryName = (id: any) => {
        if (!ContryHelper.contries)
            return "";
        var item = ContryHelper.contries.find(x => x.Id == id);
        return item.Country["zh-CN"];
    }
}